import request from "@/utils/request.js"
import { userTokenStore } from "@/stores/token"

//文章分类列表查询
export const ArticleCategoryListService = ()=> {
    // const tokenStore = userTokenStore()
    // //在pinia中定义的响应式数据，都不需要.value
    // return request.get('/category',{headers:{'Authorization':tokenStore.token}})
    return request.get('/category')
}

//文章分类添加
export const ArticleCategoryAddService = (category)=> {
    return request.post('/category',category)
}

//文章分类修改
export const ArticleCategoryUpdateService = (categoryData)=> {
    return request.put('/category',categoryData)
}

//文章分类删除
export const ArticleCategoryDeleteService = (id)=> {
    return request.delete('/category?id='+id)
}

//文章列表查询
export const ArticleListService = (params)=> {
    return request.get('/article',{params})
}

//文章添加
export const ArticleAddService = (articleData)=> {
    return request.post('/article',articleData)
}